# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=fstrcmp
pkgver=0.7
pkgrel=1
arch="all"
url="http://fstrcmp.sourceforge.net/"
pkgdesc="Make fuzzy comparisons of strings and byte arrays"
license="GPL-3.0-or-later"
makedepends="libtool ghostscript groff"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::http://fstrcmp.sourceforge.net/fstrcmp-$pkgver.D001.tar.gz"
builddir="$srcdir/$pkgname-$pkgver.D001"

prepare() {
	default_prepare
	update_config_guess

	# Fix version on pkg-config file
	sed -i "s|^Version:.*|Version: $pkgver|" "$builddir"/libdir/pkgconfig/fstrcmp.pc.in
}

build() {
	./configure \
		--prefix=/usr
	make
}

check() {
	make test
}

package() {
	DESTDIR="$pkgdir" make install
}

sha512sums="aaeb0227afd5ada5955cbe6a565254ff88d2028d677d199c00e03b7cb5de1f2c69b18e6e8b032e452350a8eda7081807b01765adbeb8476eaf803d9de6e5509c  fstrcmp-0.7.tar.gz"
